<template>
  <div class="subpage">
    <div class="banner"></div>
    <student-subject @click="goView"></student-subject>
  </div>
</template>

<script>
  import studentSubject from '@/components/student-subject'
  let that = null
  export default {
    name: 'course',
    components: {studentSubject},
    data () {
      return {
        userInfo: {},
        modeType: '',
        fileHost: this.$store.getters.fileHost,
        studentSubjectList: []
      }
    },

    beforeCreate () {
      that = this
    },

    mounted () {
      this.modeType = this.$route.query.modeType
      this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
    },

    methods: {
      goView (val) {
        this.$router.push({
          name: 'courseList',
          query: {
            subjectId: val.id
          }
        })
      },

      // 获取学员学习科目
      getStudentSubjectList () {
        that.axios.get(that.$httpApi.httpUrl('/system/subject'), {
          params: {
            studentId: that.userInfo.studentId,
          }
        }).then(function (response) {
          that.studentSubjectList = response.data.data
        })
      }
    }
  }
</script>
<style lang='scss' scoped>
  .subpage{
    .banner{
      width: 100%;
      height: 360px;
      background: url('/static/image/bannerpic.png') no-repeat;
      background-size:100% 100%;
      background-position: center;
    }
    .subjectinfo{
      width: 1200px;
      margin: 0 auto;
      background-color: #ca0000;
      padding: 10px;
      min-height: 500px;
      display: flex;
      margin-top: 20px;
      margin-bottom: 20px;
      .userinfo{
        width: 200px;
        height: 100%;
        .userul{
          width: 100%;
          color: #fff;
          padding-left: 20px;
          padding-top: 20px;
          li{
            height: 45px;
            .text2{text-indent: 2em;line-height: 30px;}
          }
        }
      }
      .subinfo{
        flex: 1;
        height: 100%;
        background-color: #fff;
        padding: 10px;
        .back{
          width: 100%;
          text-align: right;
          color:#ca0000;
        }
        .subbox{
          width: 100%;
          display: flex;

        }
      }

    }
  }

  .subbox ul {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
  }
  .subbox{
    width: 100%;
    box-sizing: border-box;
  }
  .subbox li {
    box-sizing: border-box;
    width: 30%;
    min-height: 240px;
    float: left;
    margin-left: 15px;
    margin-right: 15px;
    margin-bottom: 30px;
    border-left: 1px solid #eaeceb;
    border-right: 1px solid #eaeceb;
    box-shadow: 0 2px 3px #b2b2b2;
    text-align: center;
    img{
      height: 199px;
      width: 100%;
      display: block;
    }
    p{line-height: 50px;}
  }
</style>
